mir: use parent_window's impl for GDK_INPUT_ONLY windows
authorWilliam Hua <william@attente.ca>
Fri, 28 Nov 2014 13:33:03 +0000 (08:33 -0500)
committerWilliam Hua <william@attente.ca>
Thu, 5 Feb 2015 16:26:17 +0000 (17:26 +0100)
Fixes a crash that occurs when the user selects text.

gdk/mir/gdkmirdisplay.c

index 5c27b53582018cec338547713d6a42ed21c4b0df..cc92a53795b90cbf5f26e3e20c6053dd2481cbab 100644 (file)
@@ -416,9 +416,20 @@ gdk_mir_display_create_window_impl (GdkDisplay    *display,
   g_printerr (" location=(%d, %d)", window->x, window->y);
   g_printerr (" size=(%d, %d)", window->width, window->height);
   g_printerr ("\n");
-  if (attributes->wclass != GDK_INPUT_OUTPUT)
-    return;
-  window->impl = _gdk_mir_window_impl_new ();
+
+  if (attributes->wclass == GDK_INPUT_OUTPUT)
+    {
+      window->impl = _gdk_mir_window_impl_new ();
+      window->impl_window = window;
+    }
+  else /* attributes->wclass == GDK_INPUT_ONLY */
+    {
+      window->impl = g_object_ref (real_parent->impl);
+      window->impl_window = real_parent;
+
+      /* FIXME: this is called in gdk_window_new, which sets window->impl_window
+       * back to window after this function returns. */
+    }
 }
 
 static GdkKeymap *